package me.flyray.bsin.facade.service;

import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import java.io.IOException;
import java.util.Map;

public interface ElasticsearchService {

    /**
     * 创建索引
     */
    @POST
    @Path("createIndex")
    @Produces("application/json")
    public Map<String, Object> createIndex(Map<String, Object> requestMap) throws ClassNotFoundException, IOException;

    /**
     * 删除索引
     */
    @POST
    @Path("deleteIndex")
    @Produces("application/json")
    public Map<String, Object> deleteIndex(Map<String, Object> requestMap) throws ClassNotFoundException, IOException;

    /**
     * 添加文档数据
     */
    @POST
    @Path("addDocument")
    @Produces("application/json")
    public Map<String, Object> addDocument(Map<String, Object> requestMap) throws ClassNotFoundException, IOException;

    /**
     * 查询文档数据
     */
    @POST
    @Path("getDocument")
    @Produces("application/json")
    public Map<String, Object> getDocument(Map<String, Object> requestMap) throws ClassNotFoundException, IOException;

    /**
     * 删除文档数据
     */
    @POST
    @Path("deleteIndex")
    @Produces("application/json")
    public Map<String, Object> deleteDocument(Map<String, Object> requestMap) throws ClassNotFoundException, IOException;


    /**
     * 更新文档数据
     */
    @POST
    @Path("updateDocument")
    @Produces("application/json")
    public Map<String, Object>  updateDocument(Map<String, Object> requestMap) throws ClassNotFoundException, IOException;

    /**
     * 更新文档数据
     */
    @POST
    @Path(" getDocumentListByKeyword")
    @Produces("application/json")
    public Map<String, Object>   getDocumentListByKeyword(Map<String, Object> requestMap) throws ClassNotFoundException, IOException;
}
